package com.gexiaobao.pigeon.app.model.bean

import android.os.Parcelable
import kotlinx.android.parcel.Parcelize

/**
 * @Author      : hxw
 * @Date        : 2023/3/3 14:45
 * @Describe    :
 */
@Parcelize
class ShopCarListResponse(

    var total: Int = 0,
    var list: ArrayList<ListBean> = ArrayList()

) : Parcelable {

    /**
     * 数据是否为空
     */
    fun isEmpty() = list == null || (list as List<*>).isEmpty()

    @Parcelize
    class ListBean(

        var shopId: Int = 0,
        var shopName: String = "",
        var list: ArrayList<ListGoodsBean> = ArrayList(),
        var isStoreChecked: Boolean = false,
        var check: Int = 0,

        ) : Parcelable {

        /**
         * 数据是否为空
         */
        fun isEmpty() = list == null || (list as List<*>).isEmpty()

        @Parcelize
        class ListGoodsBean(

            var goodName: String = "",
            var salePrice: Double = 0.00,
            var showPrice: Double = 0.00,
            var finalPrice: Double = 0.00,
            var discountPrice: Double = 0.00,
            var showOnePrice: Double = 0.00,
            var finalOnePrice: Double = 0.00,
            var discountOnePrice: Double = 0.00,
            var status: Int = 0,
            var goodId: Int = 0,
            var buyCount: Int = 0,
            var check: Int = 0,
            var deletedAt: String = "",
            var specName: String = "",
            var specImg: String = "",
            var id: Int = 0,
            var specId: Int = 0,
            var isInvalid: Int = 0,//1已失效
            var invalidReason: String = "",
            var isChecked: Boolean = false,
            var useCoupon: ArrayList<CouponList> = arrayListOf()

        ) : Parcelable {

            /**
             * 数据是否为空
             */
            fun isEmpty() = useCoupon == null || (useCoupon as List<*>).isEmpty()

            @Parcelize
            class CouponList(

                var id: Int = 0,
                var couponName: String = "",
                var money: Double = 0.00,
                var condition: Double = 0.00,
                var effEnd: String = "",//到期时间
                var useTypeLabel: String = ""

            ) : Parcelable
        }

    }
}